package com.kob.backend.controller.user.bot;

import com.kob.backend.pojo.Bot;
import com.kob.backend.service.user.bot.BotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class BotController {

    @Autowired
    private BotService botService;

    @PostMapping("/api/user/bot/add/")
    public Map<String,String> addBot(Bot bot){
        return botService.addBot(bot);
    }
    @PostMapping("/api/user/bot/delete/")
    public Map<String,String> deleteBot(Integer id){
        return botService.deleteBot(id);
    }
    @PostMapping("/api/user/bot/update/")
    public Map<String,String> updateBot(@RequestParam Map<String,String> data){
        return botService.updateBot(data);
    }
    @PostMapping("/api/user/bot/getBots/")
    public List<Bot> getBots(){
        return botService.getBotsByUser();
    }
}
